package com.zs.demo;

import com.zs.spring.*;

@Component("userService")
@Scope("singleton")
public class UserServcie implements BeanNameAware {

    @Value("xxxx")
    private String userName;

    @Autowired
    private User user;

    private String beanName;

    @Override
    public void set(String beanName) {
        this.beanName = beanName;
    }

    @Override
    public String toString() {
        return "UserServcie{" +
                "userName='" + userName + '\'' +
                ", user=" + user +
                ", beanName='" + beanName + '\'' +
                '}';
    }
}
